﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Data.Objects;
using System.Data.Entity;
using System.Data.EntityClient;

namespace project.Controllers
{
    public class AdminController : Controller
    {
        hoanghaEntities hh = new hoanghaEntities();
        //
        // GET: /Admin/

        public ActionResult Index()
        {
            return View();
        }
        [HttpGet]
        public ActionResult Categories()
        {
            return View();
        }
        [HttpPost]
        [ValidateInput(false)]
        [AllowHtml]
        public ActionResult Categories(Category c)
        {
            if(ModelState.IsValid){ 
                Response.Write(c.description);
                //hh.Categories.AddObject(c);
                //hh.SaveChanges();
                return View(c);
            }
            return View(c);
        }
        public ActionResult Test()
        {
            return View();
        }

    }
}
